Repository navigation
Fix open Dependabot and CodeQL alerts - #42
Merged
Merged
Conversation
Raise floors so pip installs get the fixes, not only the lockfile: certifi>=2026.10.18 and pyasn1>=0.6.5 in the base install, authlib>=1.9.1 and joserfc>=1.7.6 in the dashboard extra, litellm>=1.100.4, and soupsieve>=4.0 and tornado>=6.6.1 in the notebook extra. Every fixed soupsieve needs Python 3.11.5+. Its floor carries that marker, and uv.lock now covers 3.11.5+ only ([tool.uv] environments). Resolving for older 3.11 releases had put beautifulsoup4 4.6.3 (2018) and an unpatched soupsieve in the lock. The package still installs on any 3.11. In the dashboard, override typescript-eslint's minimatch to 11.x. No 10.x release has the fix, and typescript-estree only calls minimatch(path, pattern, opts), which 11.x keeps. Signed-off-by: Oktie Hassanzadeh <oktie@oktie.com>
Benchmark ids, judge config names, SQLite db_ids and logo names come from requests and end up in file names. They now go through one helper, safe_paths.safe_join, which accepts only plain names and checks that the normalized result stays inside its base folder. The prefix check is the form CodeQL recognizes, which clears the py/path-injection alerts. Two real gaps this closes: - A db_id such as "../../x" could open any x.sqlite on the host. - The playground and the evaluation job loaded any YAML path sent as llm_judge_config_path. They now accept only a config from the two judge config folders (by listed path or by name) and answer 400 otherwise. The DB2 LIMIT rewrite started its regex with \s+, so search() rescanned a run of spaces from every position in it: about one second for 20,000 spaces. It now starts at the word LIMIT. Output is unchanged. Signed-off-by: Oktie Hassanzadeh <oktie@oktie.com>
Without a permissions block the jobs get the repository's default token permissions, which can include write access (CodeQL actions/missing-workflow-permissions). Both workflows now default to contents: read. The publish and github-release jobs keep their own job-level grants. Signed-off-by: Oktie Hassanzadeh <oktie@oktie.com>
With litellm installed, an unknown model prefix is routed to LiteLLM instead of raising UnsupportedModel. Both tests check the install without it, so they now say so by turning litellm off. Signed-off-by: Oktie Hassanzadeh <oktie@oktie.com>
Signed-off-by: Oktie Hassanzadeh <oktie@oktie.com>
oktie
force-pushed
the
fix/security-alerts
branch
from
November 14, 2026 22:43
c664795 to
12f3d23
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The config path check permits symlinked files to escape the config directory, allowing GET to read and PUT to overwrite external files.
1 open issue
1 file not reviewed
dashboard/package-lock.json: Generated file
What changed in this PR
This PR addresses the security alerts tracked in #18 across the toolkit’s dependencies, dashboard API file handling, SQL execution, and GitHub Actions workflows.
Changes:
- Raises security-related dependency floors and updates Python and dashboard lockfiles.
- Adds shared path validation, restricts judge-config selection, and removes quadratic behavior from the DB2
LIMITrewrite. - Sets read-only workflow permissions and adds regression tests.
| File | Description |
|---|---|
uv.lock |
Updates dependency resolution and limits lockfile support to Python 3.11.5+. |
tests/test_public_api_behaviour.py |
Makes unknown-provider testing independent of LiteLLM installation. |
tests/test_path_safety.py |
Adds path-validation and DB2 rewrite regression tests. |
tests/test_model_client_dispatch.py |
Explicitly disables LiteLLM fallback for refusal testing. |
src/text2sql_eval_toolkit/ui/routers_judge.py |
Centralizes validation of requested judge-config paths. |
src/text2sql_eval_toolkit/ui/routers_judge_configs.py |
Updates containment terminology in a comment only. |
src/text2sql_eval_toolkit/ui/routers_jobs.py |
Validates judge-config paths before scheduling evaluations. |
src/text2sql_eval_toolkit/ui/routers_execution.py |
Validates SQLite IDs and playground judge-config paths. |
src/text2sql_eval_toolkit/ui/routers_benchmarks.py |
Uses safe joins for benchmark logo paths. |
src/text2sql_eval_toolkit/ui/indexes.py |
Rejects unsafe evaluation-artifact paths. |
src/text2sql_eval_toolkit/safe_paths.py |
Adds a shared plain-name and path-containment helper. |
src/text2sql_eval_toolkit/indexing/store.py |
Validates benchmark-derived artifact paths. |
src/text2sql_eval_toolkit/execution/execution_tools.py |
Avoids repeated whitespace scanning in DB2 normalization. |
pyproject.toml |
Raises dependency floors and configures lockfile support. |
dashboard/package.json |
Overrides typescript-eslint’s minimatch dependency. |
dashboard/package-lock.json |
Locks minimatch 11 and its dependency changes. |
CHANGELOG.md |
Documents security fixes and compatibility constraints. |
.github/workflows/release.yml |
Sets read-only default token permissions. |
.github/workflows/ci.yml |
Sets read-only default token permissions. |
Review effort: Balanced
Moving _contained to safe_join dropped the resolve() it used to do, so a judge config file that is a symlink to somewhere outside its folder was accepted again: GET read the target and PUT overwrote it. _contained now also checks that the resolved file is directly inside the resolved folder. A symlinked folder still works, and so does a link to another config in the same folder. The config list skips a config it can't use instead of failing the whole request, and a request may name the config folder with or without symlinks resolved, as the list used to show resolved paths. Signed-off-by: Oktie Hassanzadeh <oktie@oktie.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes the open alerts listed in #18: 23 Dependabot alerts and 62 CodeQL alerts.
Dependabot PRs #34, #35, #36, #38, #40 and #41 are merged, and this branch is rebased on them. #39 was closed: see soupsieve below.
Dependencies
pyproject.toml>=1.9.1(dashboard extra)>=1.7.6(dashboard extra)>=2026.10.18(base)>=0.6.5(base)>=1.100.4(litellm extra)>=6.6.1(notebook extra)>=4.0on Python 3.11.5+ (notebook extra)package.jsonThe Dependabot PRs only changed
uv.lock. The floors matter forpip install, which ignoresuv.lock.soupsieve. Every fixed soupsieve needs Python 3.11.5+. Dependabot's #39 dealt with that by locking beautifulsoup4 4.6.3 (from 2018) for older 3.11 releases. Here
uv.lockcovers Python 3.11.5+ only ([tool.uv] environments), and the floor has a version marker, so the package still installs on any 3.11.minimatch. No 10.x release has the fix. typescript-estree only calls
minimatch(path, pattern, opts), which 11.x keeps. Dashboard lint passes.dashboard/distdoesn't change.CodeQL
py/path-injectiondb_id, logo names) go through a newsafe_paths.safe_join. It accepts only plain names and checks that the result stays inside its folder. Judge configs also keep their symlink check, so a config file that links outside its folder is refused.py/polynomial-redosLIMITregex started with\s+and rescanned runs of spaces: about 1 second for 20,000 spaces. It now starts at the wordLIMIT. Output is unchanged.actions/missing-workflow-permissionsci.ymlandrelease.ymldefault topermissions: contents: read.Two real problems turned up while fixing the path alerts. Both endpoints are full tier, so only local operators and signed-in full users could reach them:
POST /api/benchmarks/{id}/executewithdb_id: "../../x"opened anyx.sqliteon the host.llm_judge_config_path. With the old code, a request for/etc/passwdmade the job try to parse it. Now only configs from the two judge config folders are accepted, by the path the config list shows or by name. Anything else gets a 400.Dismissed, no code change:
py/clear-text-logging-sensitive-data: false positive. They log the name of the env var (TEXT2SQL_SECRET_KEY), not its value.py/sql-injectioninrun_sql_and_get_dataframe_mysql_async: won't fix. Running the SQL the user typed is what the SQL playground is for, and the route is full tier.py/incomplete-url-substring-sanitizationininference_tools.py: false positive. It checks an error message for a hostname; it isn't validating a URL.Python scanning was off in CodeQL default setup from Oct 27, so the Python alerts could not close. It is back on. The fixed alerts close when
mainis scanned after this merges.Other
Two tests assumed the litellm extra is not installed. They now turn it off themselves.
Checks
pytest: 1237 passed, including 32 new tests intests/test_path_safety.py. The three symlink tests fail without 11534f8.uv lock --check, coverage floors: pass.npm audit: 0 vulnerabilities.Closes #18